<?php
class PostgresqlDb extends G_DB{
    public function escape($string) {
        return pg_escape_string($string);
    }

    public function exec($sql) {
        return pg_query($this->_db_con,$sql);
    }

    public function fetch($rs) {
        return pg_fetch_assoc($rs);
    }

    public function free($rs) {
        return pg_free_result($rs);
    }

    public function getAffectedRows($rs) {
        return pg_affected_rows($rs);
    }

    public function getInsertId($rs) {
        return pg_last_oid($rs);
    }

    public function query($sql) {
        return pg_query($this->_db_con,$sql);
    }    
}